package Opter;

import Libray.Book;
import Libray.BookShelf;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xwl
 * Date: 2023-04-16
 * Time: 17:23
 */
public class ShowOpter implements IOpter{
    @Override
    public void opterFun(BookShelf bookShelf, String name) {
        // ret接收书的数量
        int ret = bookShelf.getBookNum();
        System.out.println(ret);
        // books接收书架
        Book[] books = bookShelf.getBooks();
        for (int i = 0; i < ret; i++) {
            System.out.println(books[i].toString());
        }
    }
}
